/**
 * 封装ajax请求
 */

class Http {
	ajax(url,params, callback) {
		$.ajax({
			url: url,
			type: "POST",
			dataType: "json",
			crossDomain: true,
			data: params,
			success: function(res) {
				callback(res);
			},
			fail: function(err) {
				callback(err);
			}
		});
	};
	login(params,callback) {
		this.ajax('/admin/login', params, (res) => {
			callback(res)
		});
	};
	add_user(params,callback) {
		this.ajax('/admin/add_user', params, (res) => {
			callback(res)
		});
	}
	update_user(params,callback) {
		this.ajax('/admin/update_user', params, (res) => {
			callback(res)
		});
	}
	del_user(params,callback) {
		this.ajax('/admin/del_user', params, (res) => {
			callback(res)
		});
	}
	del_more(params,callback) {
		this.ajax('/admin/del_more', params, (res) => {
			callback(res)
		});
	}
	open_admin(params,callback) {
		this.ajax('/admin/open_admin', params, (res) => {
			callback(res)
		});
	}
	del_admin(params,callback) {
		this.ajax('/admin/del_admin', params, (res) => {
			callback(res)
		});
	}
	add_admin(params,callback) {
		this.ajax('/admin/add_admin', params, (res) => {
			callback(res)
		});
	}
	update_admin(params,callback) {
		this.ajax('/admin/update_admin', params, (res) => {
			callback(res)
		});
	}
	del_mess(params,callback) {
		this.ajax('/admin/del_mess', params, (res) => {
			callback(res)
		});
	}
	del_mess_more(params,callback) {
		this.ajax('/admin/del_mess_more', params, (res) => {
			callback(res)
		});
	}
	del_comment(params,callback) {
		this.ajax('/admin/del_comment', params, (res) => {
			callback(res)
		});
	}
	del_comment_more(params,callback) {
		this.ajax('/admin/del_comment_more', params, (res) => {
			callback(res)
		});
	}
}
var _http = new Http();